package com.google.code.test.stock;

import org.junit.runner.RunWith;

import com.google.code.Bunit;
import com.google.code.Given;
import com.google.code.Then;
import com.google.code.When;

@RunWith(Bunit.class)
public class RefoundItemScenario {

    @Given("a customer who bought a black jumper")
    private Customer customer;

    @Given("three black jumpers in stock")
    private Stock stock;

    @When("the customer returns the jumper for a refund")
    public void refound() {

        stock.refound(customer, customer.getProducts().get(0));
    }

    @Then("the stock should have four black jumpers")
    public boolean ensureFourBlackJumpers() {

        return stock.getProducts().size() == 4;
    }

    @Then("the customer should have an empty history")
    public boolean ensureCustomerWithZeroProducts() {

        return customer.getProducts().isEmpty();
    }
}
